<title>图片切换</title>
<meta charset="utf-8" />
<link rel="icon" href="https://www.baidu.com/favicon.ico" />
<meta name="viewport" content="width=device-width" />

<button onclick="show1()">1</button>
<button onclick="show2()">2</button>
<button onclick="show3()">3</button>
<button onclick="show4()">4</button>
<button onclick="show5()">5</button>

<button onclick="prev()">һ</button>
<button onclick="next()">һ</button>

<button onclick="suoXiao()">С</button>
<button onclick="fangDa()">Ŵ</button>
<hr />

<img width="300" id="pic" src="1.jpg" />

<script>
var i = 1;
var w = 300;

function fangDa(){
  w = w * 1.1;
  pic.width = w;
}

function next(){
  i++;
  if(i==6) i = 1;
  pic.src = i+".jpg";
}

function show1(){
  pic.src = "1.jpg";
  i = 1;
}

function show2(){
  pic.src = "2.jpg";
  i = 2;
}

function show3(){
  pic.src = "3.jpg";
  i = 3;
}

function show4(){
  pic.src = "4.jpg";
  i = 4;
}

function show5(){
  pic.src = "5.jpg";
  i = 5;
}
</script>